import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/major_hazard_information_entity.dart';

MajorHazardInformationEntity $MajorHazardInformationEntityFromJson(Map<String, dynamic> json) {
  final MajorHazardInformationEntity majorHazardInformationEntity = MajorHazardInformationEntity();
  final String? activationTime = jsonConvert.convert<String>(json['activationTime']);
  if (activationTime != null) {
    majorHazardInformationEntity.activationTime = activationTime;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    majorHazardInformationEntity.address = address;
  }
  final int? closestDistance = jsonConvert.convert<int>(json['closestDistance']);
  if (closestDistance != null) {
    majorHazardInformationEntity.closestDistance = closestDistance;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    majorHazardInformationEntity.companyCode = companyCode;
  }
  final String? controlHead = jsonConvert.convert<String>(json['controlHead']);
  if (controlHead != null) {
    majorHazardInformationEntity.controlHead = controlHead;
  }
  final String? controlHeadPhone = jsonConvert.convert<String>(json['controlHeadPhone']);
  if (controlHeadPhone != null) {
    majorHazardInformationEntity.controlHeadPhone = controlHeadPhone;
  }
  final String? controlHeadPosition = jsonConvert.convert<String>(json['controlHeadPosition']);
  if (controlHeadPosition != null) {
    majorHazardInformationEntity.controlHeadPosition = controlHeadPosition;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    majorHazardInformationEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    majorHazardInformationEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    majorHazardInformationEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    majorHazardInformationEntity.deleted = deleted;
  }
  final String? deviceAreaHazards = jsonConvert.convert<String>(json['deviceAreaHazards']);
  if (deviceAreaHazards != null) {
    majorHazardInformationEntity.deviceAreaHazards = deviceAreaHazards;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    majorHazardInformationEntity.hazardCode = hazardCode;
  }
  final String? rvalue = jsonConvert.convert<String>(json['rvalue']);
  if (rvalue != null) {
    majorHazardInformationEntity.rvalue = rvalue;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    majorHazardInformationEntity.riskObjectName = riskObjectName;
  }
  final String? hazardRank = jsonConvert.convert<String>(json['hazardRank']);
  if (hazardRank != null) {
    majorHazardInformationEntity.hazardRank = hazardRank;
  }
  final String? hazardSimpleName = jsonConvert.convert<String>(json['hazardSimpleName']);
  if (hazardSimpleName != null) {
    majorHazardInformationEntity.hazardSimpleName = hazardSimpleName;
  }
  final String? hazardType = jsonConvert.convert<String>(json['hazardType']);
  if (hazardType != null) {
    majorHazardInformationEntity.hazardType = hazardType;
  }
  final String? hazardTypeLabel = jsonConvert.convert<String>(json['hazardTypeLabel']);
  if (hazardTypeLabel != null) {
    majorHazardInformationEntity.hazardTypeLabel = hazardTypeLabel;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    majorHazardInformationEntity.id = id;
  }
  final int? inChemicalIndustrialPark = jsonConvert.convert<int>(json['inChemicalIndustrialPark']);
  if (inChemicalIndustrialPark != null) {
    majorHazardInformationEntity.inChemicalIndustrialPark = inChemicalIndustrialPark;
  }
  final int? isKeynote = jsonConvert.convert<int>(json['isKeynote']);
  if (isKeynote != null) {
    majorHazardInformationEntity.isKeynote = isKeynote;
  }
  final String? keyProcessesName = jsonConvert.convert<String>(json['keyProcessesName']);
  if (keyProcessesName != null) {
    majorHazardInformationEntity.keyProcessesName = keyProcessesName;
  }
  final String? latitude = jsonConvert.convert<String>(json['latitude']);
  if (latitude != null) {
    majorHazardInformationEntity.latitude = latitude;
  }
  final String? longitude = jsonConvert.convert<String>(json['longitude']);
  if (longitude != null) {
    majorHazardInformationEntity.longitude = longitude;
  }
  final String? mainHead = jsonConvert.convert<String>(json['mainHead']);
  if (mainHead != null) {
    majorHazardInformationEntity.mainHead = mainHead;
  }
  final String? mainHeadPhone = jsonConvert.convert<String>(json['mainHeadPhone']);
  if (mainHeadPhone != null) {
    majorHazardInformationEntity.mainHeadPhone = mainHeadPhone;
  }
  final String? mainHeadPosition = jsonConvert.convert<String>(json['mainHeadPosition']);
  if (mainHeadPosition != null) {
    majorHazardInformationEntity.mainHeadPosition = mainHeadPosition;
  }
  final int? numberEstimation = jsonConvert.convert<int>(json['numberEstimation']);
  if (numberEstimation != null) {
    majorHazardInformationEntity.numberEstimation = numberEstimation;
  }
  final String? parkName = jsonConvert.convert<String>(json['parkName']);
  if (parkName != null) {
    majorHazardInformationEntity.parkName = parkName;
  }
  final String? productionCapacity = jsonConvert.convert<String>(json['productionCapacity']);
  if (productionCapacity != null) {
    majorHazardInformationEntity.productionCapacity = productionCapacity;
  }
  final String? tecHead = jsonConvert.convert<String>(json['tecHead']);
  if (tecHead != null) {
    majorHazardInformationEntity.tecHead = tecHead;
  }
  final String? tecHeadPhone = jsonConvert.convert<String>(json['tecHeadPhone']);
  if (tecHeadPhone != null) {
    majorHazardInformationEntity.tecHeadPhone = tecHeadPhone;
  }
  final String? tecHeadPosition = jsonConvert.convert<String>(json['tecHeadPosition']);
  if (tecHeadPosition != null) {
    majorHazardInformationEntity.tecHeadPosition = tecHeadPosition;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    majorHazardInformationEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    majorHazardInformationEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    majorHazardInformationEntity.updateDate = updateDate;
  }
  return majorHazardInformationEntity;
}

Map<String, dynamic> $MajorHazardInformationEntityToJson(MajorHazardInformationEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['activationTime'] = entity.activationTime;
  data['address'] = entity.address;
  data['closestDistance'] = entity.closestDistance;
  data['companyCode'] = entity.companyCode;
  data['controlHead'] = entity.controlHead;
  data['controlHeadPhone'] = entity.controlHeadPhone;
  data['controlHeadPosition'] = entity.controlHeadPosition;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['deviceAreaHazards'] = entity.deviceAreaHazards;
  data['hazardCode'] = entity.hazardCode;
  data['rvalue'] = entity.rvalue;
  data['riskObjectName'] = entity.riskObjectName;
  data['hazardRank'] = entity.hazardRank;
  data['hazardSimpleName'] = entity.hazardSimpleName;
  data['hazardType'] = entity.hazardType;
  data['hazardTypeLabel'] = entity.hazardTypeLabel;
  data['id'] = entity.id;
  data['inChemicalIndustrialPark'] = entity.inChemicalIndustrialPark;
  data['isKeynote'] = entity.isKeynote;
  data['keyProcessesName'] = entity.keyProcessesName;
  data['latitude'] = entity.latitude;
  data['longitude'] = entity.longitude;
  data['mainHead'] = entity.mainHead;
  data['mainHeadPhone'] = entity.mainHeadPhone;
  data['mainHeadPosition'] = entity.mainHeadPosition;
  data['numberEstimation'] = entity.numberEstimation;
  data['parkName'] = entity.parkName;
  data['productionCapacity'] = entity.productionCapacity;
  data['tecHead'] = entity.tecHead;
  data['tecHeadPhone'] = entity.tecHeadPhone;
  data['tecHeadPosition'] = entity.tecHeadPosition;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension MajorHazardInformationEntityExtension on MajorHazardInformationEntity {
  MajorHazardInformationEntity copyWith({
    String? activationTime,
    String? address,
    int? closestDistance,
    String? companyCode,
    String? controlHead,
    String? controlHeadPhone,
    String? controlHeadPosition,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? deviceAreaHazards,
    String? hazardCode,
    String? rvalue,
    String? riskObjectName,
    String? hazardRank,
    String? hazardSimpleName,
    String? hazardType,
    String? hazardTypeLabel,
    String? id,
    int? inChemicalIndustrialPark,
    int? isKeynote,
    String? keyProcessesName,
    String? latitude,
    String? longitude,
    String? mainHead,
    String? mainHeadPhone,
    String? mainHeadPosition,
    int? numberEstimation,
    String? parkName,
    String? productionCapacity,
    String? tecHead,
    String? tecHeadPhone,
    String? tecHeadPosition,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return MajorHazardInformationEntity()
      ..activationTime = activationTime ?? this.activationTime
      ..address = address ?? this.address
      ..closestDistance = closestDistance ?? this.closestDistance
      ..companyCode = companyCode ?? this.companyCode
      ..controlHead = controlHead ?? this.controlHead
      ..controlHeadPhone = controlHeadPhone ?? this.controlHeadPhone
      ..controlHeadPosition = controlHeadPosition ?? this.controlHeadPosition
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..deviceAreaHazards = deviceAreaHazards ?? this.deviceAreaHazards
      ..hazardCode = hazardCode ?? this.hazardCode
      ..rvalue = rvalue ?? this.rvalue
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..hazardRank = hazardRank ?? this.hazardRank
      ..hazardSimpleName = hazardSimpleName ?? this.hazardSimpleName
      ..hazardType = hazardType ?? this.hazardType
      ..hazardTypeLabel = hazardTypeLabel ?? this.hazardTypeLabel
      ..id = id ?? this.id
      ..inChemicalIndustrialPark = inChemicalIndustrialPark ?? this.inChemicalIndustrialPark
      ..isKeynote = isKeynote ?? this.isKeynote
      ..keyProcessesName = keyProcessesName ?? this.keyProcessesName
      ..latitude = latitude ?? this.latitude
      ..longitude = longitude ?? this.longitude
      ..mainHead = mainHead ?? this.mainHead
      ..mainHeadPhone = mainHeadPhone ?? this.mainHeadPhone
      ..mainHeadPosition = mainHeadPosition ?? this.mainHeadPosition
      ..numberEstimation = numberEstimation ?? this.numberEstimation
      ..parkName = parkName ?? this.parkName
      ..productionCapacity = productionCapacity ?? this.productionCapacity
      ..tecHead = tecHead ?? this.tecHead
      ..tecHeadPhone = tecHeadPhone ?? this.tecHeadPhone
      ..tecHeadPosition = tecHeadPosition ?? this.tecHeadPosition
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
